﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Maticsoft.DAL;
using System.Reflection;
using System.IO;
using Commons.CommonHelper;
using BuildingForm.Common;
using BuildingForm.PersonInfo;

namespace BuildingForm
{
    public partial class PersonEntryExitInfo : Form, IModuleExtension 
    {
        public PersonEntryExitInfo()
        {
            InitializeComponent();
            //this.ShowIcon = false;
            this.panel1.Width = this.Width - 120;
            this.panel1.Height = this.Height;
            this.panel1.Left = 122;
            this.panel1.Top = 0;
            Panel panel2 = new Panel();
            
            panel2.Width = 2;
            panel2.Height = this.Height;
            panel2.Left = 120;
            panel2.Top = 0;
            panel2.BackColor = Color.Gray;
            this.BackColor = Color.LightGray;
            this.Controls.Add(panel2);
            BuildingForm.PersonInfo.BankInfo ps = new PersonInfo.BankInfo();
            //PersonSalary ps = new PersonSalary();
            
            ps.TopLevel = false;
            ps.FormBorderStyle = FormBorderStyle.None;
            ps.Width = this.Width - 122;
            ps.Height = this.Height;
            ps.Left = 0;
            ps.Top = 0;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ps);
            ps.Show();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PersonSalary ps = new PersonSalary();
            ps.TopLevel = false;
            ps.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ps);
            ps.Width = this.Width - 122;
            ps.Height = this.Height;
            ps.Left = 0;
            ps.Top = 0;
            ps.Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            PersonPassInOut ppi = new PersonPassInOut();
            ppi.TopLevel = false;
            ppi.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ppi);
            ppi.Width = this.Width - 122;
            ppi.Height = this.Height;
            ppi.Left = 0;
            ppi.Top = 0;
            ppi.Show();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            EmployeeEntryExit eee = new EmployeeEntryExit();
            eee.TopLevel = false;
            eee.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(eee);
            eee.Width = this.Width - 122;
            eee.Height = this.Height;
            eee.Left = 0;
            eee.Top = 0;
            eee.Show();
        }

        private void button4_Click(object sender, EventArgs e)
        {
            AttendanceStatistics ass = new AttendanceStatistics();
            ass.TopLevel = false;
            ass.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ass);
            ass.Width = this.Width - 122;
            ass.Height = this.Height;
            ass.Left = 0;
            ass.Top = 0;
            ass.Show();
        }

        /// <summary>
        /// 调用窗口
        /// </summary>
        /// <param name="title">窗体名称</param>
        /// <param name="xmmc">项目名称</param>
        /// <returns></returns>
        public bool ShowExtension(string title, string xmmc)
        {
            try
            {
                this.ShowDialog();
                return true;
            }
            catch (Exception ex)
            {
                MessageBox.Show("加载失败！");
                return false;
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            BuildingForm.PersonInfo.BankInfo ppi2 = new PersonInfo.BankInfo();
            ppi2.TopLevel = false;
            ppi2.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ppi2);
            ppi2.Width = this.Width - 122;
            ppi2.Height = this.Height;
            ppi2.Left = 0;
            ppi2.Top = 0;
            ppi2.Show();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            BuildingForm.PersonInfo.MonthStatistics ppi2 = new PersonInfo.MonthStatistics();
            ppi2.TopLevel = false;
            ppi2.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ppi2);
            ppi2.Width = this.Width - 122;
            ppi2.Height = this.Height;
            ppi2.Left = 0;
            ppi2.Top = 0;
            ppi2.Show();
        }

        private void button7_Click(object sender, EventArgs e)
        {
            BuildingForm.PersonInfo.Reissue ppi2 = new Reissue();
            ppi2.TopLevel = false;
            ppi2.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ppi2);
            ppi2.Width = this.Width - 122;
            ppi2.Height = this.Height;
            ppi2.Left = 0;
            ppi2.Top = 0;
            ppi2.Show();
        }

        private void button4_Click_1(object sender, EventArgs e)
        {
            BuildingForm.PersonInfo.AddressInfoManage ppi2 = new AddressInfoManage();
            ppi2.TopLevel = false;
            ppi2.FormBorderStyle = FormBorderStyle.None;
            this.panel1.Controls.Clear();
            this.panel1.Controls.Add(ppi2);
            ppi2.Width = this.Width - 122;
            ppi2.Height = this.Height;
            ppi2.Left = 0;
            ppi2.Top = 0;
            ppi2.Show();
        }
    }
}
